﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace HYBYSoft.Company.Models
{
    [MetadataType(typeof(Links_Metadata))]
    public partial class Links
    {

        public class Links_Metadata
        {
            public int LinkID { get; set; }

            [Display(Name = "链接名称"), Required(ErrorMessage = "链接名称不能为空")]
            [StringLength(50, ErrorMessage = "超过字符最大数")]
            public string Title { get; set; }

            [RegularExpression(@"^(http|https|ftp)\://([a-zA-Z0-9\.\-]+(\:[a-zA-Z0-9\.&amp;%\$\-]+)*@)?((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])|([a-zA-Z0-9\-]+\.)*[a-zA-Z0-9\-]+\.[a-zA-Z]{2,4})(\:[0-9]+)?(/[^/][a-zA-Z0-9\.\,\?\'\\/\+&amp;%\$#\=~_\-@]*)*$", ErrorMessage = "链接地址必须为完整http格式，如：http://www.baidu.com")]
            [Display(Name = "链接地址"), Required(ErrorMessage = "链接地址不能为空")]
            [StringLength(50, ErrorMessage = "超过字符最大数")]
            public string Url { get; set; }

            [Display(Name = "链接图标")]
            [StringLength(50, ErrorMessage = "超过字符最大数")]
            public string Icon { get; set; }


            [Display(Name = "创建人")]
            [StringLength(16, ErrorMessage = "超过字符最大数")]
            public string Creator { get; set; }


            [Display(Name = "创建时间")]
            public DateTime CreateTime { get; set; }


            [Display(Name = "最后修改人")]
            [StringLength(16, ErrorMessage = "超过字符最大数")]
            public string Editor { get; set; }


            [Display(Name = "最后修改时间")]
            public DateTime LastEditTime { get; set; }


            [Display(Name = "是否在首页显示")]
            public int IsShow { get; set; }


            [Display(Name = "首页显示顺序")]
            public int Rank { get; set; }

        }

    }
}
